home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 3: Developer Tools / Linux Cubed Series 3 - Developer Tools.iso / devel / make / icmake-6.000 / icmake-6 / icmake / pp / finddef.c < prev    next >
Encoding:
C/C++ Source or Header  |  1994-03-01  |  925 b   |  39 lines

  1. /*
  2. \funcref{finddef}{int finddef (\params)}
  3.     {
  4.         {char} {*s} {identifier to search for}
  5.     }
  6.     {index in {\em defined} array if identifier found, or {\em -1} if not
  7.      found}
  8.     {}
  9.     {}
  10.     {finddef.c}
  11.     {
  12.  
  13.         Function {\em finndef()} attempts to find an identifier {\em s} in the
  14.         array of defined identifiers. The {\em defined} array consists of
  15.         structs, holding the redefined identifier (field {\em ident}) and the
  16.         redefinition string (field {\em redef}).
  17.  
  18.         An index into {\em defined} is returned; at {\em defined[ret].redef}
  19.         the redefinition string can be found. If the identifier is not found in
  20.         {\em redef}, {\em --1} is returned.
  21.  
  22.     }
  23. */
  24.  
  25. #include "icm-pp.h"
  26.  
  27. int finddef (s)
  28. char *s;
  29. {
  30.     register int
  31.         i;
  32.  
  33.     for (i = 0; i < ndefined; i++)
  34.         if (! strcmp (defined [i].ident, lexbuf))
  35.             return (i);
  36.  
  37.     return (-1);
  38. }
  39.